package com.everyline.baselibrary.ext

import android.app.Activity
import android.app.Application
import android.os.Bundle
import com.blankj.utilcode.util.LogUtils

/**
 * 作者　: hegaojian
 * 时间　: 20120/1/7
 * 描述　:
 */
class KtxLifeCycleCallBack : Application.ActivityLifecycleCallbacks {

    override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
        LogUtils.d("onActivityCreated==========${activity.localClassName}")
        KtxActivityManger.pushActivity(activity)

    }

    override fun onActivityStarted(activity: Activity) {
        LogUtils.d("onActivityStarted==========${activity.localClassName}")

    }

    override fun onActivityResumed(activity: Activity) {
        LogUtils.d("onActivityResumed==========${activity.localClassName}")

    }

    override fun onActivityPaused(activity: Activity) {
        LogUtils.d("onActivityPaused==========${activity.localClassName}")

    }


    override fun onActivityDestroyed(activity: Activity) {
        LogUtils.d("onActivityDestroyed==========${activity.localClassName}")

        KtxActivityManger.popActivity(activity)
    }


    override fun onActivityStopped(activity: Activity) {
        LogUtils.d("onActivityStopped==========${activity.localClassName}")

    }

    override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {
        LogUtils.d("onActivitySaveInstanceState==========${activity.localClassName}")
    }


}